package com.microservice.chapter1;

import com.microservice.chapter1.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloController {

    @Autowired
    User user;

    @Value("${user.userName}")
    private String userName;

    @ResponseBody
    @RequestMapping("/user")
    public User user(){



        return user;
    }


    @ResponseBody
    @RequestMapping("/hello")
    public String hello(){
        return "Hello World!";
    }


}
